changed lab 6 code