updated code, tests, and readme