changed type of int to size_t