added function to test device orientation