add basic func and tests