Ensured that functions can only be generated once
Added minor function name mangling