added unstable direction calculations