changed invert directions to just reduce directions