Add replacement routine.
Tidy.