Corrected a few errors and added an index