Nitpick: we usually start with a capital letter after the keyword, so "When" instead of "when".