solution for morestuff exercise 3