updated pysim to be better memory efficient