Some simple library functions