Optimize sigscan and delete[] variable (oops)