Added new class and changed program slightly.