Final Changes

Cleaned up the code, added notes, etc.