fixing code snippets; thx @dpvc