you can pickup an e36 m3 off of e-bay for $9000 give or take a grand, doing the swap would probably end up being more because with the 318 you would have to get a large case differential so you could handle the power of the S50/S52 reliably, you would also have to get an E36 transmission and a custom drive shaft, not to mention engine mounts, transmission mounts, swapping the wiring harness, ecu, sensors, custom exhaust, stiffer shocks and springs, bigger sway bars etc., then after you do all that you need a larger fuel pump, and you have to figure out how to hook up all the gauges to the new engine and ecu. Another thing... the S52 engine is an OBD2 engine.