update to calculator in chapter 4