add to_a and to_h functions