finished rewrite of Index