Update example.py

Now using functions, instead of a class