changing c to c++; sigwinch handler added