added flipElement()