adding to_array method