replace prints with loggings.