method remaining =
    match selected with
      | None -> 0
      | Some (_,s) -> s#remaining