Change algorithm for calc det and volume of element