Grab bag of miscellaneous code