Bacterial intelligence