Completed lab 7 using while loops