global variables modified and inner class defined