update to using size_type instead of int for grad, hess, size, etc. in most places