added zero direction calculation functionality