working from lesson 30 (Building a new app). Changed very little.