typedef'd all structs, Corrected include orders, Formatted code