Moved unnecessary global into main