Changed coordinate system and tightened up classes