let update_assoc l x y = 
    let rec update_rec ll = match ll with 
      | []       -> [(x,y)]
      | (u,v)::c -> if (u=x) then 
          if (y>=v) then (x,y)::c else ll
        else (u,v)::(update_rec c)
    in l := update_rec (!l)