Changed opts to a global variable to minimize noise