private static String form( String f )
    {
        String s = "";
        if( ! f.contains( "+" ) )
        {
            return f;
        }
        String[] st = f.split( " \\+ " );
        int[] a = new int[st.length];
        int m = 0;
        for( int i = 0; i < st.length; i++ )
        {
            a[i] = ANFParser.count( st[i], 'x' );
            if( a[i] > m )
            {
                m = a[i];
            }
        }
        for( int i = m; i >= 0; i-- )
        {
            for( int j = 0; j < st.length; j++ )
            {
                if( a[j] == i )
                {
                    s += ( st[j] + " + " );
                }
            }
        }
        return s.substring( 0, s.length() - 3 );
    }