Changed module distribution algorithm