ConvertToPolish, checkBrackets