merged new ocr code from 3/31 Romain email