Fix the solution to spiral matrix problem