implemented drag and drop functionality