Modified variational solution of the Thomas-Fermi equation for atoms