added speed scaling to gains