working on rl.m