Added iterative reversing algorithm for Python