Added r optimizer work.