direction calculation fixed
direction calculation fixed