Developing matrix version
Code working and brief test written
Commented