Code for week 4

This week 4 code for labs 8, 9, 10