Python 3 pysim implementation