Changed function of Tomatoes class

added more event driven logic