Migration gravitation code from graphics module