He beat the buffaloes with a long , polished bamboo , and told Kamya , one of the boys , to graze the cattle by themselves , while he went on with the buffaloes , and to be very careful not to stray away from the herd .