Added a table of contents, small bug fixes