modified a little in OCR code