start of move logic