Completed functionality for canMove() and MatchingTiles()