misc. functions.