literally copied and pasted the entire code from Eps to MuinvPml and changed k=1 and it works. Also made some simple changes in case this doesn't work