refactoring
bug fix and add test
change version number to 0.0.2