added logging, improved behaviours