make caching optional
test for duplicates
test for caching