Code in process of cleaning.

Deleted extra comments, removed unused functions, and cleaned up the
third algo.