renamed
added isValidMove