Added a replaceString function for use with 2 positions