getting substrings