Added indices calculation