Rohit's R Code