Smarter ordering of gap fill