Updated localize function of polygon