implement solution for week 4