copied dragging code over. need to deal with linking