added function prototypes into state.h