added window calculation
removed superceded Trigger class