Rewrote behavior creation routine.