Updated code lab 9