finished general move logic