general tools i've written, misc code