adjusted more Direction-dependent code