Adding new_array and supporting functions.