created matrix and stuff