changed info and singular matrix check so that it returns 1 if singular
this avoids returning 0 if the first diagonal element is zero