adding if to readme snippets