What if you felt like eating raw vegetables, you'll never know when you're through the vegetables and into the vegetables.
Your algorithm needs another if-clause.
It's approximating volumetrics, which I think is the smartest idea around.
If we're pointing out important flaws: this strategy doesn't work for fruit!
I have a strategy for getting myself to eat vegetables. I've been using it for about six months now, and it works well:
Side effect: people who see my plate think I'm a very healthy eater. But sometimes they ask my "why is your salad steaming?"
I also posted this on my blog