distributed coefficients working; still need to optimize and remove a bunch of debugging code