add pseudo code for RRP