added 'int i' as instance variable