Un-fucking-believable... The fact that you got this to work or even made sense of this code puts you miles ahead of me.
My first thought was that you accidentally used yc somewhere instead of y or vice-versa but that doesn't seem to be the case given the method you've used. I hope someone can get this worked out because I've tried for a long time to get this one to work properly.
Kudos!
----------------------
I have officially retired from sucking at everything I do. Life is much easier now.