add comments and tests
add beginning of readme