Added vertical flip function