First pass at nested sections. Pretty trashy code but it works.