corrected variable type from int to size_t for rc and wc