ID uses a loop instead of recursion

ID uses a loop instead of recursion
added more thorough testing to nextID
removed outdated documentation from ID