reverse the output list