generate a spiral matrix