added two variants of the contains method (for ranges)