iteartion and prev_message calculations are added