final working program used on demo day