Solved SpiralMatrix problem