added logging
minor changes