completed lab 5 example code