fixed the coordinate system, added pretty print function