WebAppDev ch4 ex2, functionality