templated dimension
matrix sizes are member vars instead of template parameter now