initial commit of state.h and pack.c