Added derivation of the functional for the River Crossing lab.