Updated echo func and a testing method.