some refactoring, might not return to this since don't want wolfram alpha in main tree