implement gold challenge for Chapter 19
Refactor gold challenge from Ch19