changed size_t's to uints