Changed drawing method for rectangles.