Adding sort to modules so that module widths will be updated in depth order.