Refactor code so that we don't check face down state each time through the inner loop