added extend, and options arg