clean up code; add example config file