changing index to the tabular format