refactored, but untested implementation of behaviors and nodes