added some bits of python code