make it a boolean.

change the kneel function to return a true/false value,
and use it to avoid an infinite loop in the walk state.