Work on automatic orientation setting