Validation of movement moved to function isValidMove