Take a look at this tutorial to get a feel for how you could go about adjusting variables using the Spark.function():