chapter 5: added two models and DB functionality