Turns out we need coefficients to be double** in all cases