rprog assignment 2