re-wrote column logic and refactor solve_for_one_rows