87 Fourtrax new CDI, weak spark, still wont run

I bought this quad and it had a classic CDI problem, sometimes it just wouldnt start. Bought a different one off ebay and fired right up, worked fine for a couple times then all the sudden wouldnt start, No spark. Put the old CDI on and got some spark but it was intermittent and weak. The quad would sputter but would not start and run. What else can this problem be? What else to look at? Also can anyone tell me what the wires on the CDI go to? Thanks a bunch