code generation completed. stil needs further testing