improved drag and drop. still duplicate code still has to die!