Index: doc/theses/mike_brooks_MMath/programs/hello-accordion.cfa
===================================================================
--- doc/theses/mike_brooks_MMath/programs/hello-accordion.cfa	(revision caa3e2c3915285f713ced61f49de1c3340dc903f)
+++ doc/theses/mike_brooks_MMath/programs/hello-accordion.cfa	(revision 4558df29929781e8d911ce6cdc5f0dfac9ef0d8b)
@@ -8,19 +8,20 @@
 
 
-forall( T, @[NprovTerty]@, @[Nmunicipalities]@ )
-struct CanPop {
-	array( T, @NprovTerty@ ) provTerty; $\C{// nested VLA}$
-	array( T, @Nmunicipalities@ ) municipalities; $\C{// nested VLA}$
-	int total_pt, total_mun;
+forall( [C], [S] ) $\C{// Class size, Students in class}$
+struct School {
+	@array( int, C )@ classIds; $\C{// nested VLAs}$
+	@array( int, S )@ studentIds;
+	@array( int, C, S )@ preferences; $\C{// multidimensional}$
 };
+
 
 
 // TODO: understand (fix?) why these are needed (autogen seems to be failing ... is typeof as struct member nayok?)
 
-forall( T, [NprovTerty], [Nmunicipalities] )
-	void ?{}( T &, CanPop( T, NprovTerty, Nmunicipalities ) & this ) {}
+forall( [C], [S] )
+void ?{}( School( C, S ) & this ) {}
 
-forall( T &, [NprovTerty], [Nmunicipalities] )
-	void ^?{}( CanPop( T, NprovTerty, Nmunicipalities ) & this ) {}
+forall( [C], [S] )
+	void ^?{}( School( C, S ) & this ) {}
 
 
@@ -37,10 +38,9 @@
 
 
-
-forall( T, [NprovTerty], [Nmunicipalities] )
-void check( CanPop( T, NprovTerty, Nmunicipalities ) & pop ) with( pop ) {
-	total_pt = total_mun = 0;
-	for ( i; NprovTerty ) total_pt += provTerty[i];
-	for ( i; Nmunicipalities ) total_mun += municipalities[i];
+forall( [C], [S] )
+void init( @School( C, S ) & classes@, int class, int student, int pref ) with( classes ) {
+	classIds[class] = class; $\C{// handle dynamic offsets of fields within structure}$
+	studentIds[student] = student;
+	preferences[class][student] = pref;
 }
 
@@ -58,20 +58,54 @@
 
 
-int main( int argc, char * argv[] ) {
-	const int npt = ato( argv[1] ), nmun = ato( argv[2] );
-	@CanPop( int, npt, nmun ) pop;@
-	// read in population numbers
-	@check( pop );@
-	sout | setlocale( LC_NUMERIC, getenv( "LANG" ) );
-	sout | "Total province/territory:" | pop.total_pt;
-	sout | "Total municipalities:" | pop.total_mun;
+int main() {
+	int classes, students;
+	sin | classes | students;
+	@School( classes, students ) school;@
+	int class, student, preference;
+	// read data into school calling init
+	// for each student's class/preferences
+	try {
+		for ( ) {
+			sin | class | student | preference;
+			init( school, class, student, preference );
+		}
+	} catch( end_of_file * ) {}
+	for ( s; students ) {
+		sout | "student" | s | nonl;
+		for ( c; classes ) {
+			sout | school.preferences[c][s] | nonl;
+		}
+		sout | nl;
+	}
 }
+
+
+
 /*
-$\$$ ./a.out  13  3573
-Total province/territory: 36,991,981
-Total municipalities: 36,991,981
-$\$$ ./a.out  13  3654
-Total province/territory: 36,991,981
-Total municipalities: 36,991,981
+$\$$ cat school1
+2 2
+0 0 1
+1 0 7
+0 1 12
+1 1 13
+$\$$ a.out < school1
+student 0 1 7
+student 1 12 13
+
+$\$$ cat school2
+3 3
+0 0 1
+1 0 7
+2 0 8
+0 1 12
+1 1 13
+2 1 14
+0 2 26
+1 2 27
+2 2 28
+$\$$ a.out < school2
+student 0 1 7 8
+student 1 12 13 14
+student 2 26 27 28
 */
 
Index: doc/theses/mike_brooks_MMath/programs/school1
===================================================================
--- doc/theses/mike_brooks_MMath/programs/school1	(revision 4558df29929781e8d911ce6cdc5f0dfac9ef0d8b)
+++ doc/theses/mike_brooks_MMath/programs/school1	(revision 4558df29929781e8d911ce6cdc5f0dfac9ef0d8b)
@@ -0,0 +1,5 @@
+2 2
+0 0 1
+1 0 7
+0 1 12
+1 1 13
Index: doc/theses/mike_brooks_MMath/programs/school2
===================================================================
--- doc/theses/mike_brooks_MMath/programs/school2	(revision 4558df29929781e8d911ce6cdc5f0dfac9ef0d8b)
+++ doc/theses/mike_brooks_MMath/programs/school2	(revision 4558df29929781e8d911ce6cdc5f0dfac9ef0d8b)
@@ -0,0 +1,10 @@
+3 3
+0 0 1
+1 0 7
+2 0 8
+0 1 12
+1 1 13
+2 1 14
+0 2 26
+1 2 27
+2 2 28
