implement _extends
test and debug _extends