Updated gyroscope code