You can avoid a lot of this ```Math.pow()``` stuff by using the Groovy power operator: "For example, 5**3 equals to Math.pow(5,3)." (http://groovy.codehaus.org/Groovy+Math)