Added simple replace algorithm realization