use size_t consistently to remove warnings