Alter Foreach param func to take indices