fixed some incorrect comments
added logic to generate random ids