Merge pull request #24 from wingyplus/master

test 9th pass
refactor by use loop