I believe I have come up with an algorithm which would work. Currently It's only on paper, and will not have time to code this program for a few days. The algorithm finds the innermost bracket and works its way out. In each bracket it evaluates and replaces the strings in order of operation. For instance, take the question 3(4(2/4^2*5)). The algorithm would find the innermost bracket, and then it would search for the "^". Once found, it would search on either side of it for the "^" for the closest operator. It would then take the integerst between those operators and put them into an equation. Essentially, it will find the 4 and the 2 on either side of the "^", and then carry out the equation. Then we simply replace the "4^2" with the answer, "16". Now it would do the same thing for Division. It will find the 2 and the 16 on each side of the "/", and evaluate it. It would then replace it and go onto the next operator. In this way we will eventually arrive at a single integer. Its actually quite simple, but took me some time to wrap my head around.