This will not affect the result much if the formulas are off; just improve the precision a little bit once everything is working as intended.
What does this mean?
Yeah, me neither. There's too much going on at once. Why don't you try to break up the code in small chunks as I suggested in reply #7 and debug piece by piece?