finished code for tutorial05.txt