Used a reverse iteration to improve the performance of the code
Merge pull request #1 from arthurfigueiredo/patch-1

Used a reverse iteration to improve the performance of the code