w2ex3 -- I misunderstood the requirements, fixed
w2ex3 refactored a tiny bit