Generate records in the correct sequence