input entries are sorted