Added more functions to deal with matrix reduction and determinants, etc