miscellaneous bits of code