added logging instead of printlns