clarified code for lab 8