counts' acc time ((now, pos):times)
  | now == time = counts' (if pos == Start then acc + 1 else acc - 1) now times
  | now > time = ((time, now), acc)
                 : counts' (if pos == Start then acc + 1 else acc - 1) now times
counts' acc time ((now, pos):times)
  | now == time = counts' (if pos == Start then acc + 1 else acc - 1) now times
  | now > time = ((time, now), acc)
                 : counts' (if pos == Start then acc + 1 else acc - 1) now times
counts' acc time ((now, pos):times)
  | now == time = counts' (if pos == Start then acc + 1 else acc - 1) now times
  | now > time = ((time, now), acc)
                 : counts' (if pos == Start then acc + 1 else acc - 1) now times