the first loop is done 0