changed index to not rely on params