changed inverse calc so singularity warning doesnt show