RED: undo test still failing
implemented purge and flush
decode #return
decode #return