Started implementing replace functions