A friend asked me to renew the head gasket on his BMW. When I got the car work had already been started on it. The intake side and the front had stripped to the head. None of the electricals had been marked but I figured it shouldn't be a problem. Well I did the head gasket and got to assembling the things that I didn't remove and found most of the plugs are interchangable I started looking for a wiring diagram. Best I could find of what I already had was a computer program from Mitchells. Some of the wire colors matched some didn't. Through some trial and error I got everything hooked up but now I can't get it to idle properly and the idle won't step up when put in gear or turn on the A/C. Trying to take off in gear I really have to play with it a bit but when it finally takes off it runs really good. The MIL is on and I am getting 2 codes- 1525 A camshaft position actuator control open circut and 1519 A camshaft position actuator. Sounds as though both are caused by the same problem which looks like the cam actuator is unplugged or no more good. I am assuming this is the electrical part of the VANOS mounted on the front of the head. Can someone please put my assumptions to rest and help get me straight? Thanks