cleanup
Performance fix: compare file and document text length instead of entire text