modified location parsing algorithm to remove duplicate strings within same string too