added new function for allocating a range of ids