function declarations and calls fully working to code generation