added a couple of if & when code examples