recovery: fixed stats computation
recovery: cpp: plugged in append and sort