Created contains method.