Moving example to code