fixed example configuration
restructured the code a bit