Make the logic a little better.