groovy implementation