I saw your request, it seems this is just bugsy code with little modifications. And what you added is bad, so this makes me think you don't understand the code and you can't support it. Unapproved for now, if you want to work on the plugin PM me and I will post a list with the requiered changes.