rearrange code slightly. add simple 'test' script
Merge pull request #2 from enjalot/master

rearrange code slightly. add simple 'test' script