some logic cleanup, added portrait gyro support