Added the determinant argument for scaling. Things seem to be working