step 1
moved some coords to be arrays in stead
more refactors
made a few objects, clustered functions to related places