add coefficient logic