Implemented gather.