Condensed code. Comments throughout.

Many files changed