moved var delcarations, fixed whitespace issues, changed id attribute to data-index attribute
whitespace changes for coding standards
Changed "private" variables to use underscores
Reformatted documentation