Where did you work on this earlier? I suggest you post the link to the other threads so that people can follow your old ones.

As for your code, it might be operator precedence that could be...