Add flatten to ex2_18.coffee