removed for loop entirely while pattern matching in favor of string.replace + regex