removed the local declaration of variables in main