New algorithm to convert location