92 Buick lesabre code 31 & stalls

just thought iíd update this in case any one else has the same problem.
Itís the 6 cylinder engine(3.8L?). A little noisy but after 315k
miles nothing out of the ordinary.
I have one of those lovely code readers that gives out 75 possible answers to a code and not quite sure where to start looking. I had an error of 41 (cam sensor) for a while now and wasnít too worried about it. car still started and ran wonderfully. Then, the other day my car died as i was traveling down the road. was hot. thought it might have been the ignition module. went and verified it. tested several times to try and heat it up. still passed. I read code 31 and 41. finaly got the car to start up and drove the 3 miles home without issue. I pull out the code reader and get code 13, 31, and 41. I reset the computer and it still started perfectly. drove 5 miles to the gas station and filled up(name brand) and back home.. no issues. stopped the car at home then started it up 3 times. finally died on me again. would crank. but not seem to fire off. So, the following day, I went and replaced the cam sensor and verified my magnet had not fallen out yet. this cleared the code 41 totally. reset the computer again and did a test drive. ses light flashed on 3 times on the test drive. once at a light when taking off. and car almost seemed to lose power, but it did not die. sure enough when I get home the only code is a 31. I drive it in to work this morning and light flashed (31) yet again (within 2 minutes of turning the car on) but drove fine the 20 miles to work.
I still get 30 miles to the gallon but I probably need to change the timing chain again.
any idea what would cause the car to stall on this code?
if anyone needs more technical information or what the codes are I will update this when I get home. itís too early and I donít remember anything more at this point. but thanks in advance for any help you can give.
update: died several times on the way home and going down the highway it restarted itself before i could take it our of gear. I got home and decided to start again at the basics and see what i could find. apparently my positive cable on the battery would up being loose. the threads were actually stripped on the steel screw for the terminal. never had a striped battery screw before. so i replaced it and everythign is workng fime. so if you ever have a problem of your buick dying and it popping up with a code 31. go check the battery cables again. Itís always the little stuff that gets me.
Posted using the http://www.autoforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
Add image file

Motorsforum.com is a website by car enthusiasts for car enthusiasts. It is not affiliated with any of the car or spare part manufacturers or car dealers discussed here. All logos and trade names are the property of their respective owners.