modefied trap.c trap.h