def _update_order_book(self, bids, asks, side, price, remaining):
    if (side in ['bid', 'buy']):
        book = bids
        cut = int(((99 * (len(book) - 1)) / 100))
    else:
        book = asks
        cut = int(((len(book) - 1) / 100))
    if (price < book[cut][0]):
        res = self._binary_search(price, book, 0, (cut - 1))
    else:
        res = self._binary_search(price, book, cut, (len(book) - 1))
    if (res[1] == 'True'):
        if (remaining < self.Config['AmountMin']):
            del book[res[0]]
        else:
            book[res[0]][1] = remaining
    elif (remaining >= self.Config['AmountMin']):
        book.insert(res[0], [price, remaining])
def _update_order_book(self, bids, asks, side, price, remaining):
    if (side in ['bid', 'buy']):
        book = bids
        cut = int(((99 * (len(book) - 1)) / 100))
    else:
        book = asks
        cut = int(((len(book) - 1) / 100))
    if (price < book[cut][0]):
        res = self._binary_search(price, book, 0, (cut - 1))
    else:
        res = self._binary_search(price, book, cut, (len(book) - 1))
    if (res[1] == 'True'):
        if (remaining < self.Config['AmountMin']):
            del book[res[0]]
        else:
            book[res[0]][1] = remaining
    elif (remaining >= self.Config['AmountMin']):
        book.insert(res[0], [price, remaining])