removed extraneous tparam
changed remaining int's to ptrdiff_t