Added some code for drawing the view