implement dragging square