Updated Generation and input output code