The important part of your code has been cut off. Also, it isn't clear to me what the actual problem is. What do you mean that it works "sort of".
- Ben
The important part of your code has been cut off. Also, it isn't clear to me what the actual problem is. What do you mean that it works "sort of".