implement appendChild and prependChild