added new constraints to eventDemand and added functional tests