update ocr algorithm