updated hash_to_array to support boolean and integer data types