added int i=0;