Changed matrices to have layout be column major