ABCD matrices changed to matrix type