Updated gravity.py