assignment2 from r_programming course