new and improved gravity implementation