Finished add-regular-edges function.