implemented .extend() method

Closes #9