some changes to data stored and returned, also re-sorted some code and changed the ID generation method