series example updated and adopted for code generation