3.3. Palm detector with states