Added function to calculate and return determinant