Add couple of functions and tests