added code and part 4 for lab 11