implemented a naive Extend method.