author code to address question #5