some of the sample code from exercism