adding code to print array in spiral