JS tweak for fading algo