added second function appendTo