An improved PSO algorithm for distributed localization in wireless sensor networks