Behavior determines juvenile confinement period