what is the function of the gearbox