Port more to python