use int instead of size_t