Refactorings, fixed coordinate system.

Separated parsing into parser class.
Coordinate system fixed.
Things made a little more efficient.