improves gravity calculations