some code I've written for various things...