anchor.diff:          type Polygons = pset<Polygon>
   
           type Scene = { polygons : Polygons }
  -        type State = pmod<list<V3f>> * Scope.Unique
  +        type State = { polygon : pmod<list<V3f>>; unique : Scope.Unique; 
  +                       hoverPosition : IModRef<Option<Polygon * pmod<V3f>>>; 
  +                       selectedPoint : ref<Option<pmod<V3f>>>
  +                       dragging      : ref<bool> }
   
           type Logics = Scene * State
   
  -        let createScene (wc : WorkingCopy) = { polygons = Scope.pset wc "polygons" }
  +        let createScene () = { polygons = Scope.pset git "polygons" }
  +
  +        let createWorkingState () = 
  +            { polygon        = Scope.pmod git "workingPolygon" []; 
  +              unique         = Scope.empty ()
  +              hoverPosition  = Mod.init None;
  +              selectedPoint  = ref None
  +              dragging       = ref false
  +            }
  +
               
  -        let interact (wc : WorkingCopy) ((scene,(state,name)) : Logics) (commit : bool)  (op : Operation) =
  +        let interact ((scene,state) : Logics) (commit : bool)  (op : Operation) =
               let changes =
                   [
                       match op with
                           | AddPoint p   -> 
  -                            yield state <~ p :: state.Value
  +                            yield state.polygon <~ p :: state.polygon.Value
                           | ClosePolygon ->
  -                            let closedPolygon = state.Value |> List.toArray
  +                            let closedPolygon = state.polygon.Value |> List.toArray
                               if closedPolygon.Length > 0 then
                                   let newPolygon = 
  -                                    Scope.uniqueScope name (fun scope ->
  -                                        state.Value 
  -                                            |> List.mapi (fun i v -> Scope.pmod wc (sprintf "%d" i) v) 
  +                                    Scope.uniqueScope state.unique (fun scope ->
  +                                        state.polygon.Value 
  +                                            |> List.mapi (fun i v -> Scope.pmod git (sprintf "%d" i) v) 
                                               |> List.rev
  -                                            |> Scope.pmod wc scope
  +                                            |> Scope.pmod git scope
                                   )
                                   yield PSet.add scene.polygons newPolygon
  -                            yield state <~ []
  -                        | MovePoint (p,newPos) ->
  -                            yield p <~ newPos
  +                            yield state.polygon <~ []
  +                        | MovePoint (newPos) when !state.dragging  ->
  +                            yield (!state.selectedPoint).Value <~ newPos
  +                        | ToggleMoving when !state.dragging ->
  +                            state.dragging := false
  +                            state.selectedPoint := None
  +                        | ToggleMoving when not !state.dragging && state.hoverPosition.Value.IsSome ->
  +                            state.dragging := true
  +                            state.selectedPoint := Some (snd state.hoverPosition.Value.Value)
  +                        | ToggleMoving | MovePoint _ -> ()
                   ]
  -            for c in changes do wc.apply c
  +            for c in changes do git.apply c
               let action = sprintf "%A" op
   
               if commit then
  -                wc.commit action
  -                Git2Dgml.visualizeHistory (Path.combine [ __SOURCE_DIRECTORY__; "polygons.dgml" ]) (wc.Branches |> Dictionary.toList) |> ignore
  +                git.commit action
  +                Git2Dgml.visualizeHistory (Path.combine [ __SOURCE_DIRECTORY__; "polygons.dgml" ]) (git.Branches |> Dictionary.toList) |> ignore
  +
  +    module Picking =
  +        open Logics
  +
  +        let pick ((scene, state):Logics) =
  +            let polygons = (scene.polygons :> aset<_>).GetReader()
  +            fun (camera : Camera) (current : PixelPosition) ->
  +                
  +                polygons.GetDelta() |> ignore
  +                let changes =
  +                    [
  +                        let pick = Camera.pickRay camera current
  +                        let nearbyRay = 
  +                            polygons.Content
  +                                |> Seq.collect (fun (p : Logics.Polygon) -> 
  +                                    [ for px in p.Value do 
  +                                        let mutable hit = RayHit3d.MaxRange
  +                                        let hitD = 
  +                                            if pick.HitsSphere(V3d.op_Explicit px.Value, 0.1, 0.1, 10.0, &hit) 
  +                                            then hit.T
  +                                            else Double.MaxValue
  +                                        yield p, px, hitD
  +                                    ] )
  +                                |> Seq.sortBy (fun (_,_,d) -> d)
  +                                |> Seq.toList
  +                        match nearbyRay with
  +                            | [] -> ()
  +                            | (p,bestPosition,d)::_ when d < Double.MaxValue && not !state.dragging -> 
  +                                yield fun () -> 
  +                                    Mod.change state.hoverPosition (Some (p, bestPosition)) 
  +                            | _ -> 
  +                                yield fun () -> Mod.change state.hoverPosition None 
  +                    ]
  +
  +                transact (fun () -> 
  +                    for c in changes do c ()
  +                )
   
   
       [<AutoOpen>]
       module View =
  -
  -        let git = Git.init ()
   
           let viewTrafo = viewTrafo ()
           let frustum = perspective ()
  
positive.code:         let pset (git : WorkingCopy) (name : string) =
              git.pset (sprintf "%s.%s" (current.Value |> String.concat "") name)
  
      [<AutoOpen>]
      module Interaction =
          type Operation = AddPoint of V3f | ClosePolygon | MovePoint of pmod<V3f> * V3f
  
      module Logics =
  
          open Interaction
  
          let (<~) (p : pmod<'a>) v = PMod.change p v
          
  
negative.code:                 |> Sg.onOff (m |> Mod.map Option.isSome)    
  
          let pickSphere  = conditionally 0.040 C4b.Green camPick
          let hoverSphere = 
              conditionally 0.041 C4b.Yellow (Mod.map (Option.map (toV3d << PMod.value << snd)) workingState.hoverPosition)
          let groundPlane = Helpers.quad C4b.Gray
  
          let sg =
  