Added replaceSpaces algorithm.