Functions with only minor or no modifications from the functions written by John Haakon Husoey of the same name. Note that although the function may be the same, it may refer to structures that has been altered (in struct_defs.h).