adjust JS to use an array for the base loop instead of 2 individual options