Adding extend method and tests.