add testing and code fixes
remove console log
Merge pull request #1 from uber/add-testing

add testing and code fixes