Update code to use the function; remove conflicting use of global "lineupArray"