js teamwork and combinatorics