cleanup & bugfix

added some comments
distributed code to multiple files
fixed a bug that would allow black lines in the drawn gravitational
field to appear