The 3.0l M52 wasn't used in E46s after 2001. The 3.0l M54 replaced it through the end of the E46 model run in the US. The 2006 E90 used the 3.0l N52 motor. There were substantial engineering improvements (materials, valve train, fuel injection, etc.) made in both M54 and N52 engines that go way beyond intake, exhaust, and software to account for the differences in power.