'This is a helper method for determining the order of an element in the
Weyl group of G2.  It takes a Weyl element and if repeated simple reflections
in it, it deletes them.'

def delete_doubles(self, reflections):

    counter = 0
    copy = list(reflections)
    for elt in copy:
        if (counter < (len(copy) - 1)):
            if (copy[(counter + 1)] == elt):
                del copy[counter]
                del copy[counter]
        counter += 1
    return copy
