Added function to calculate the determinate, and added check for find inverse to only find the inverse if the determinate is not zero.