First version of the thirty-third exercise.
Added more elaborate loops.