use size_t and ssize_t instead of int