I didn't understand what you meant?

I am aware that compose object already have a append & a clear function.

Neither have I made any changes to those two functions.

I have simply added my function in between these two function.