commit assignment 2 R prog 008

changes to code as required by assignment 2 instructions