Added gyro code; not yet tested