contains_IM function

Check if needle is in haystack