assignment 3 - R programming