added preliminary flip support