first version of spiral matrix