added spark code