updated for newest spark