Now trying to avoid use of global variable. Pass original list around