Miscellaneous functions for testing & learning