Changed two vars to be of type size_t rather than int