changed to logspace to avoid disastrous underflow