Tidy up example and convert it to use only C++03 features.