miscellaneous code and scripts