Created a smart generate id function and clean timeslots