reverse and output
output fixed