fix coefs indexing