added a new function and test