Adding function `extend`