correct a bug bad array imems for m greater than one