Assorted code from an old game project