Added Python 3 compatability.