changed the matrix multiplications to be the same as lbl