made the logic more direct here.