3c3,6
< #include "list.h"
---
> 
> #include "candidate.h"
> 
> //#include "list.h"
8c11
< adjust_priority(CLASS *class, int priority, int period) {
---
> adjust_priority(TIMBER_CLASS *timber_class, int priority, int period) {
12,14c15,17
< 	tmp = class->parent_zone->priority[period];
< 	if (class->parent_au->priority[period] < tmp) {
< 		tmp = class->parent_au->priority[period];
---
> 	tmp = timber_class->parent_zone->priority[period];
> 	if (timber_class->parent_au->priority[period] < tmp) {
> 		tmp = timber_class->parent_au->priority[period];
16,17c19,20
< 	class->floatgrouplist = (LIST_PTR *)list_reset(class->floatgrouplist);
< 	group = (GROUP *)list_next(class->floatgrouplist);
---
> 	timber_class->floatgrouplist = (LIST_PTR *)list_reset(timber_class->floatgrouplist);
> 	group = (GROUP *)list_next(timber_class->floatgrouplist);
22c25
< 		group = (GROUP *)list_next(class->floatgrouplist);
---
> 		group = (GROUP *)list_next(timber_class->floatgrouplist);
24,25c27,28
< 	class->staticgrouplist = (LIST_PTR *)list_reset(class->staticgrouplist);
< 	group = (GROUP *)list_next(class->staticgrouplist);
---
> 	timber_class->staticgrouplist = (LIST_PTR *)list_reset(timber_class->staticgrouplist);
> 	group = (GROUP *)list_next(timber_class->staticgrouplist);
30c33
< 		group = (GROUP *)list_next(class->staticgrouplist);
---
> 		group = (GROUP *)list_next(timber_class->staticgrouplist);
36,37c39,40
< absolute_oldest_first(CLASS *class) {
< 	return(-class->age);
---
> absolute_oldest_first(TIMBER_CLASS *timber_class) {
> 	return(-timber_class->age);
41,42c44,45
< relative_oldest_first(CLASS *class) {
< 	return(class->parent_au->table->mha-class->age);
---
> relative_oldest_first(TIMBER_CLASS *timber_class) {
> 	return(timber_class->parent_au->table->mha-timber_class->age);
46,47c49,50
< absolute_youngest_first(CLASS *class) {
< 	return(class->age);
---
> absolute_youngest_first(TIMBER_CLASS *timber_class) {
> 	return(timber_class->age);
54,55c57,58
< 	CLASS		*class;
< 	GROUP		*group;
---
> 	TIMBER_CLASS		*timber_class;
>        	//GROUP		*group;
68,69c71,72
< 			class = (CLASS *)list_next(au->classlist);
< 			while (class != NULL) {
---
> 			timber_class = (TIMBER_CLASS *)list_next(au->classlist);
> 			while (timber_class != NULL) {
72c75
< 					only OPERABLE class types are eligible for harvest
---
> 					only OPERABLE timber_class types are eligible for harvest
74,77c77,80
< 				if ((class->class_type==OPERABLE)&&(class->age+period_length[period]>=class->parent_au->table->mha)) {
< 					/* work out proportion of class area that can be harvested, based on MHA and ReEntryLag */
< 					tmp1 = (double)((double)(class->age+period_length[period]-class->parent_au->table->mha+1)/(double)class->width);
< 					tmp2 = (double)((double)(period_length[period]-class->ReEntryLag)/(double)period_length[period]);
---
> 				if ((timber_class->class_type==OPERABLE)&&(timber_class->age+period_length[period]>=timber_class->parent_au->table->mha)) {
> 					/* work out proportion of timber_class area that can be harvested, based on MHA and ReEntryLag */
> 					tmp1 = (double)((double)(timber_class->age+period_length[period]-timber_class->parent_au->table->mha+1)/(double)timber_class->width);
> 					tmp2 = (double)((double)(period_length[period]-timber_class->ReEntryLag)/(double)period_length[period]);
86c89
< 					class->MerchArea = class->area*harvestable_proportion;
---
> 					timber_class->MerchArea = timber_class->area*harvestable_proportion;
88c91
< 					if (class->MerchArea>ROUND_ERROR) {
---
> 					if (timber_class->MerchArea>ROUND_ERROR) {
92c95
< 								priority = absolute_oldest_first(class);
---
> 								priority = absolute_oldest_first(timber_class);
95c98
< 								priority = relative_oldest_first(class);
---
> 								priority = relative_oldest_first(timber_class);
98c101
< 								priority = absolute_youngest_first(class);
---
> 								priority = absolute_youngest_first(timber_class);
101c104
< 								priority=class->RandValue;
---
> 								priority=timber_class->RandValue;
107,108c110,111
< 						priority = adjust_priority(class, priority, period);
< 						candidatelist = (LIST_PTR *)hash_insert(candidatelist, class, priority, class->RandValue);
---
> 						priority = adjust_priority(timber_class, priority, period);
> 						candidatelist = (LIST_PTR *)hash_insert(candidatelist, timber_class, priority, timber_class->RandValue);
111c114
< 				class = (CLASS *)list_next(au->classlist);
---
> 				timber_class = (TIMBER_CLASS *)list_next(au->classlist);
