indentation fixes and other minor improvements

replaced a mix of tabs and spaces with only spaces.

list index improved.