use array instead of unpack