Created cacheSolve that checks if data is cached. It then returns eather that value or adds a newly calculated value to cache and returns that value.