rprog assignment2 v1