fixed to support numWth > 1.