added drawRectangle, housekeeping