Adding functions for codegen