Add flip function.