initial commit
add tests
add encoding test