declared rc as uint16_t instead of int.