developing append and replace functions