Modified lab2.c