Removed obsolete solution and unnecessary routines, test flip and fixed
flipping method. The folding and flipped one are equal.