Finished code in ch5; just need ending