added defaults
added logging