solve method checks the columns