Hey guys, so i got this 240 about a year ago (1989 240sx ka24e) and have run into a few problems with it so far. It ran great for the entire summer and then i had some issues with it come October. The car shut down randomly when I was driving it or idling ( didn't bog down or anything just shut off ). Anyways this would only happen every few months and was very random and i believed it was linked to my crank sensor. I had trouble locating the cps because I'm used to it being on the bell housing or somewhere between the engine and the transmission and not in the distributor (hopefully i got that right?). So i pulled off the distributor cap and the rotor to get to the cps but saw that the cap and rotor were toast, terminals were completely corroded to the point where you could basically break em off. The sensor below the rotor looked fine visually no oil or water or anything on it. I replaced the rotor and cap and it ran great for about a few weeks but just this morning i was driving to work and suddenly the rpm on the dash would spike up and down at its worst it would spike up to almost 5k it would do this for about 10 seconds and it would bog down and shut off. But the thing is is that the engine rpm wouldnt go up, just on the tach, the engine still sounded as if it was at about 1k rpm even though the dash said 4k. Someone said this could be my ignition module?? Would really appreciate some help on this subject, thanks alot

!!