Added code from week 3 to week 4