Tested and works in Python 2.7