added logging calls to everything