replace u_char with uint8_t, begin reformatting