Finished writing closed form solution.