implemented the drag operation.