1997 jeep grand cherokee

MY CHEROKEE HAS BEEN DYING OUT ON ME. I CHANGED THE O2 SENSOR AND THE COIL SINCE THIS IS WHAT THE COMPUTER REGISTERED. IT STILL DIES OUT ON ME. SOMETIMES IT BACKFIRES AND DIES, OTHER TIMES IT DIES AS I AM IN IDLE. DOES ANYONE HAVE ANY IDEA WHAT THIS COULD BE? THANKS.