add code for lab 8