Misc old d code