Added correct exit procedures
Added example config file
Added some comments