solved flipsort