Fixed row/column switching problem, wrote method to check validity of solution