this is always guaranteed to terminate?