added logging and some configuration