MOD: revised setup algorithm