Solved Exercise 3.5.2 using Variables