complete revision, with unit test