remove old code
cofactor matrix
inline t_calcshape