I'm satisfied with the effort I put into this problem, but only because I'm not interested in solving it myself. If you really must have someone fix your code, you can always pay someone to do it for you.