Made the replace math/symbols function in js