added phrase extraction algorithm