Resolved exercise 3