Completed lab3.c