now works out orientation as well as position