added clear_array function