start porting the drag and drop code