Hi ! I have just bought this e30 -89. Previous owner got it in change from car sale, and didnt knew alot from it. He said that few owners back (guy who owned it 17 years, i checked), had changed an engine. it looks like its from e36, because of the position of idle control valve, and it looks like M40. i'll but few photos, if someone can tell me what engine it is, cause if i need to order parts to it, i have to know what it is

Im also asking this, cause my temp cauge dont work, and i cant find the brown temp sensor.. dont know if theres one or two (blue & brown), cant locate those. So here's the links for the pics.. (pics are old, so the engine bay doesnt look like that anymore)..
http://postimg.org/image/3kax2a9yp/
http://postimg.org/image/xptk7xadl/
http://postimg.org/image/f1z7xoovb/
(also the oil filter cap is plastic, is it plastic in original E30 engines?)
Sorry for the "messy message", but english isnt my own language, but hope you get the point.
Got also this series of numers in angine block 9.0 1 727 459 9.1
If it helps anything..
Cheers !