Added some structure to code and implemented Graphics class