rearranging statements from dsh.h to dsh.c