update jugglefest algorithm.