Solved assignment 6.4 i (!)