add tests.
fix sample
cosmetic