move if to new line, use "for (i in indices)"