ML2: new solutions for exercise 7