added foraging and minor fixes