added reference code to help me move to python 3.