Added method that creates an index after filling the table.