A distributed task-oriented self-organization algorithm that enables sensors in an ad-hoc network to organize them according to the task being announced is proposed in this paper. When a task is announced, a distributed leader election algorithm is used to select the sensor that best 'matches' the announced task based on minimizing a distance measure between the task and sensor specifications. The selected sensor then uses a task decomposition method to generate and announce the residual tasks that 'cover' the matching error. In this manner, sensors are sequentially selected until all residual tasks are 'covered'. All sensors selected by the algorithms from a sensor group for the originally announced task. To improve the communication overhead of a previous version of this algorithm, location information of each sensor is used to dynamically maintain a contributor group of sensors that may contribute to the announced task. Leader election and all task announcements are confined to this group.