Write base direction logic