implementation of fn class byte code generation. need to be tested