modified resize.c