Added simple replace code function