Converted unsigned int's to size_t's add some comments