change matrix initialization and usage

- allows a more general access