Updating chap 3 question 4 with cleaner(?) approaches