Added initial version of h(x) and h'(x) code