Measures 21 - 34

In measure 21, Chopin starts an ascending progression that goes to B minor, C# minor and finally G minor. In measure 22, the V7 of G minor is used as a German augmented sixth chord of F# minor to prepare a coda in this key. Notice the use of the Neapolitan sixth chords in measures 24 and 33: