replace int with size_t where needed, in case of 16bit int