Comleted programming exercise 3