Cleaned up user input and code layout in general.  Added comments where
necessary.  Added MIT license to header.