97 Outback rough idle and poor acceleration

So the check engine light came on and the car started running poor. Took it to the mechanic. He said plugs and wires were shot. So I replace the plugs and wires and worked good for about 4000 miles. Now the same problem is back. Code is saying cylinder 1 misfire most of the time but a couple times it said cylinder 3 misfire. I clear the code and try to see if the problem will just go away, this technique is not working! Plugs and wires look good and are secure. It works great on occasion and the check engine light will stay off for half a day occasionally. Symptoms- Rough idle(only in drive not in Neutral or park), Wants to take off when you let off the brake when the car is cold(You have to have the brake on good or it will move on you), very sluggish at times with very little power( you will be going along good and just loose power, especially on hills).

Thanks