reordered inserts to satisfy foreign key constraits