moved drag to own function