Changed from signal() to sigaction, started handling sstate chages
changed to -std=gnu99