Revert matrix struct to use array representation

instead of vectors.
Fixed multipling vectors.