Rewritten of flip (GO Implementation)