extended the groovy example a bit