Implemented question 3 A and D