converted every single float to double to increase accuracy. Moreover, I incorporated paul bourke's implementation of matrix inversion.