Implement canMove function