updated to use sparkjs