implementation of wolf with 5 states.