added logging to everything