Rename boolean "checking" in SolutionChecker() into isCorrectPath, creating 2 booleans hasNotCorrectPath for X and Y to simplify the if() block