removed -1 in computing cutoff id