Here's a very good article on the algorithm you need: http://en.wikipedia.org/wiki/Shunting_yard_algorithm
From my burrow, 2 feet under.
Forum Rules