added a function to determine the min(ID)