add simple cache solution for problem 14