corrected some compile-time errors, need to correct linkage errors now