adding is_array method and modifying pad method