improve types of reshape, and sum of arrays of arrays