Now the estimated h is also correctly calculated