fixed a few bugs

the old code doesn't work with 1-2 dogs