compute gravity using new functions in Utility.