should just use array length right away