Changed bools to uint8_t, multiply and divide by 2 to shifts, moved variable declarations in heap sort, made defines for ON and OFF for shifting.