Add tests; quickcheck ftw