added method insertSymbolByPrecedence