Added function generation. Still working on functions with returns