Added code for dragging