completed addChildAt method