Added all functions from chapters: 3, 5, 6, 8
