Make destination optional

Adds a simple check in the replace function to determine whether a destination file was given, if not the source file path is used by default