cofactor calculator