Cleanup and commenting

Added comments to all major code blocks
Removed some unnecessary comments
Implemented system for adjusting the XY coordinate system