My original implementation of mathParse