Changes to support python 3.

Changes to support python 3 in functions file.