Improved symbol look up accuracy

Rewrote the algorithm used to look up symbols, this should be a lot more accurate than the previous method. This should also be fairly quick.