changing the h functions output order