solution to week1 exercise