My RProg Assign 2

Still does not work entirely correct