Changed and added isValidMove logic