edited dimreduction functions