Lots of work on the groovy script