WIP - started support for scanned docs