gearcalc implemented as function