moved functions that are, or might be, used in more than one problem to common.c