extended gravity function

deleted parts of the old gravity func