anchor.diff:              if instance = null then raise <| new ArgumentNullException("instance")
               instance.GetType().GetMethod(methodName)  
   
  +        type CompilerContext = { InitExpr : Expression; AccExpr : Expression; ReturnExpr : Expression 
  +                                 VarExprs : ParameterExpression list; Exprs : Expression list}
  +
           let compile (queryExpr : QueryExpr) : Expression = 
  -            let rec compile' (queryExpr : QueryExpr)
  -                            (initExpr : Expression)
  -                            (accExpr : Expression)
  -                            (returnExpr :  Expression)
  -                            (varExprs : ParameterExpression list) 
  -                            (exprs : Expression list) : Expression =
  -                let current = lookup "current" varExprs
  +            let rec compile' (queryExpr : QueryExpr) (context : CompilerContext) : Expression =
  +                let current = lookup "current" context.VarExprs
                   match queryExpr with
                   | Source (:? Array as array, t) ->
                           let breakLabel = label "break"
  
positive.code:                 let accVarExpr = var "___acc___" t
                  let initExpr = assign accVarExpr (``default`` t)
                  let accExpr = addAssign accVarExpr finalVarExpr
                  let expr = compile' queryExpr' initExpr accExpr accVarExpr [accVarExpr; finalVarExpr] []
                  expr
              | _ -> failwithf "Invalid state %A" queryExpr 
  
  
negative.code:                         let indexAssignExpr = assign indexVarExpr (constant -1) 
                          let lengthExpr = arrayLength arrayVarExpr 
                          let getItemExpr = arrayIndex arrayVarExpr indexVarExpr
                          let exprs' = assign current getItemExpr :: context.Exprs
                          let checkBoundExpr = equal indexVarExpr lengthExpr 
                          let brachExpr = ``if`` checkBoundExpr (``break`` breakLabel) (block [] exprs') 
                          let loopExpr = loop (block [] [addAssign indexVarExpr (constant 1); brachExpr; context.AccExpr]) breakLabel continueLabel 
                          block (arrayVarExpr :: indexVarExpr :: context.VarExprs) [context.InitExpr; arrayAssignExpr; indexAssignExpr; loopExpr; context.ReturnExpr] :> _
  
                  | Transform (Lambda ([paramExpr], body), queryExpr') ->
                          let exprs' = assign paramExpr current :: assign current body :: context.Exprs
                          compile' queryExpr' { context with VarExprs = (paramExpr :: context.VarExprs); Exprs = exprs' }
                  | Filter (Lambda ([paramExpr], body), queryExpr') ->
                      let exprs' = assign paramExpr current :: body :: context.Exprs
                      compile' queryExpr' { context with VarExprs = (paramExpr :: context.VarExprs); Exprs = exprs' }
                  | _ -> failwithf "Invalid state %A" queryExpr 
  
              match queryExpr with
  