replace Mysis' broken code with Mysis' working code

I changed it to what you gave. You should be able to just merge it without a problem.