refactor internally a little to clean up the code.  Make the main example a real example so we make sure it compiles