implement gravitation calcualtion