Removed console log.
Updated how the replaces were implemented because previous implementation didn't allow for one result variable to be used more than once.