Added magnet dragging functionality