Changed implementation of coefficients in new branch