I checked through the code as closely as I could and I can't work this out. I'll try again after I sleep