The best way to debug a program is to make it work.
Sometimes life hits you in the head with a brick. Don’t lose faith.