Adding orientation detection