miscellaneous and partly very ^old code