set function added - but it is creating a segmentation fault - but program is compiling