added tests and convenience fns