create soma, priden, secden[2], tuftden[2], hillock, initialseg
nmyelin = 5
create node[nmyelin], myelin[nmyelin+1]

objref dendritic, somatic, tuft, second, somden, axon, sad, apic

dendritic = new SectionList()
forsec "den" dendritic.append()

tuft = new SectionList()
forsec "tuftden" tuft.append

second = new SectionList()
forsec "secden" second.append

apic = new SectionList()
forsec tuft apic.append()
priden apic.append()

somatic = new SectionList()
soma somatic.append
hillock somatic.append

somden = new SectionList()
forsec somatic somden.append()
forsec dendritic somden.append()

axon = new SectionList()
forsec "node" axon.append()
initialseg axon.append()

sad = new SectionList()
forsec somden sad.append()
forsec axon sad.append()

access soma

proc topol() {local i
	connect secden[0](0), soma(.5)
	connect secden[1](0), soma(.5)
	connect priden(0), soma(1)
	for i=0, 1 connect tuftden[i](0), priden(1)

	connect hillock(0), soma(0)
	connect initialseg(0), hillock(1)
	connect myelin[0](0), initialseg(1)
	for i=0, nmyelin-1 {
		connect node[i](0), myelin[i](1)
//		if (i == nmyelin-1) break
		connect myelin[i+1](0), node[i](1)
	}
}

proc segments() {local i
	soma.nseg= 3
	priden.nseg = 35
	forsec "tuft" nseg = 3
	forsec "secden" nseg = 5
	initialseg.nseg = 10
	hillock.nseg = 3
}

proc geometry() {local i
	soma { L = 25  diam = 20 }
	priden { L = 300  diam=2.8 }
	forsec "tuftden" { L=350  diam=1.8 }
	forsec "secden" { L=500  diam=3.3 }
	initialseg { L=20  diam=1.5 }
	hillock { L=5  diam(0:1) = soma.diam(0) : initialseg.diam(0) }
	forsec "node" { L=1 diam=1 }
	forsec "myelin" { L=1000  diam=1.5 }
	define_shape()
}
	
topol()
segments()
geometry()