converted to groovy