modified all compile errors and left one linkage error