initial commit
add tests
fix some presentation and logic bugs