bug in week3-ex solution