maybe call this a few times to make sure it's optimized (maybe take the min of a few calls?)