Sorting out ordering of modules