almost done with array manipulations