doing statistical calculations while creating indexes
created an API to create indexes