added logging. closes #1