add code for spiral matrix2