No spark

I worked on it all day and night. I managed to get spark. I have a spark. I got the engine to fire off a couple times it actually started once and ran for about 20 seconds and just stopped now I got nothing again. It does backfire and throw flames out the carb tho. I checked and I still got spark but it won't fire off again. I think I got the timing where it needs to be. I turned the engine over and got the timing mark on about 10-15 degrees before tdc and the rotor is right in the 1 wire on the cap. So that should be enough to get it started. It just pops and backfires out the carb. Idk