a bit more error checking, moved the skew's and hunt values into global variables...