Added function to find all substrings