Fixed inaccuracy in veggie counting, minor code cleanup