AC Phase Control By Tweaking PWM Output to trigger Triac

pusent:
Hello there,
While I was having a hard time controlling the phase shift between PWM and AC while working on the AC Triac trigger circuit with PWM control, I saw this code and saw it working with close to 100% performance.
I think it is much more performance than alternative solutions.
Thank you zhomeslice

Your welcome,
Keep me updated on any breakthroughs or suggestions you find
Thank you,
Z