more documentation, more modular functions, logger in one module