adding working OCR code and cleanedup some edge detection