added logging, and a unit test