Added final code for week 3