change p to a more descriptive name like state.