Updated function "h_func"