Add example file and clean up code