correct solution and employ proper backtracing.