Made some functions "static" for better optimizations by the host compiler