R programming - pa2 done