moving prints to logger instead of console.