more efficient following() for sequences