Bug fix for the last commit. We require output list in a reverse order.