added function to write positions in file, and improve wifi matching
with missing wifi signals accuracy