updated duel js with array