added extend function