Added determinant code from online, works like a charm.