Spark Code