added automatic gear code