added some comments to python code