Continuing chapter 5
Moved chapter dirs back to easier-to-use names
implemented recursive versions of duplicate functions