replaced wobbulator perl script with C code