use appropriate strategy for correct cases
fixed merge conflicts
resolved issue of numdogs exceeding 50