moved global dec to main