added extra variable

to comply with standards of homework