Made program compatible with Python3.