I think you have to look at your overall design of your program
and the way you go about reaching objectives.
I'm saying rethink of better ways to get to a result.
I could say heaps but it would lose its meaning to you.
Afterwords when you have it correct
You must ask questions to your self why you failed first time and what is necessary to avoid the same mistake.
Your key tools and what was wrong with them before building code around them.................