added filtering and extra things for ocr