The thermostat is a very common failure on these engines. If your engine is idling rough, you could have a vacuum leak. Check your 2 vent valve lines at the front of the valve covers for leaks. Another problem could be a loose oil filler cap, or the 2 crack case valves. You should be able to find plenty of info in the DIY section. You might want to look into buying some diagnostic tools for a BMW, generic readers are not much help on these cars.