prepared the two pass building, added patching capability