replaced printf with output