added spark core code