improved gyro code

Signed-off-by: James Pearman <jbpearman@mac.com>