fixed method call bug and worked on code generation