New logic for hpoterm extractions. Hopefully faster