added scaling and log-scaling options.