Code tested.

Comments need to be added.