Add flip and rotate functionality.