Modified TopModuleGenerator Logic