replace Mysis' broken code with Mysis' working code

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