added 2 funcs and tests