reverse the order of output