adapt the code to generic_array changes