finalize logic used to determine if puzzle is solved