lots of changes for melonjs