changed print outs with logging