finished all implementations, substrings could be refactored