2to3-ed

Adapted for python 3.