finally a working version using euclidian distance between WiFi access points