stable version with both dragging and flipping