Working on behavior algorithm.