Simplified solution to exercise 2.1