let apply m k = 
    try
      Some(M.find k m)
    with
      | Not_found -> None