gaussjordan implementation