various library functions