merged with lab 6 initial code