substitute/3 added and tested.