add doc strings
fix typo
add simple test to run code test-wise on command line
add license header