need to modify calculation of h