Implemented the MVC pattern for drawingRect