Finished Gerstner Algorithm