Added each with index

close #3