add tests
fix some presentation and logic bugs