partial solution for week 3