Simpler uprev algorithm working for version 0 to 1 (have not debugged for 1 to 1 or for error reports from 0 to 1).