Use reverse iteration to improve the performance