A bunch of maybe useful code snippits