changed testing part to read by states.