added algorithm that replaces spaces in the string with pattern