Fixed a couple of bugs.
Added to do
Updated comments. Reduced some redundancy.
Name change.
Fixed memory bug. Cleaned up code in modes.c.