added logging functionality: