modified emax-python