Simplify coefficient calculation
Merge pull request #52 from yuyichao/master

Simplify coefficient calculation