refine SpiralMatrix