changed allocation of helper arrays