added function to iterate on R value