Added flip functionality.