Assignment 2: write an R function that is able to cache computations