add matrix for storing unimodular transformations and improve checks for inaccuracy