Example optimization

A few little optimizations to help make the example run cleaner on my old laptop.