Completed lab4.c