Add my own solution for reverse.py