It's going to be pretty impossible to help you without any code, specifically an SSCCE. But it sounds like your problem is more intricate than a simple SSCCE, so I'm not sure what we can do over a...