use ofRectangle to keep track of position and size of object