removed printlns and added logging