improve twoPass()
Merge pull request #15 from b9707137/master

improve twoPass()