Ok, I put the logic back the way it was (albeit in a slightly different phrasing) and it seems like I didn't need to change that part anyway. Thanks for your patience.