Coordinate System was implemented by me. Now figures do not go out of the screen