got rid of get_state_pid; added STATE_PROC macro.