added stepMatrices signature, and some functional stuff to matrices