fixed long standing bug where dragging an element to a draggable placeholder from a later index results in incorrect placement. Simplified code