modified hw.c