Use improved encoder routine with more steps
Give appropriate credit for new code
Merge pull request #2 from neilmb/patch-2

Patch 2