Improving the performance of Wi-Fi indoor localization in both dense and unknown environments