working script #3 for R programming assignment 1