added output logging