added accumulated reward computation.