Solution to jaerlang2/chapter4/exercise2. Updated docstrings of previous exercises.