added some untested top level functions