mods to get it to compile better on linux