added multi-term support